import instance from "./request";
export const getSalaryList =(obj:any)=>instance({
  method:'post',
  url:'/social_securitys/list',
  data:JSON.parse(obj)
})
export const getdeportment = ()=>instance.get(`/company/department`)

//城市
export const getcity = ()=>instance.get(`/sys/city`)

//报表数据
export const getstate = (yearMonth:any)=>instance({
  method:'get',
  url:`/social_securitys/historys/${yearMonth}?opType=1`
})

//归档

export const setstate = (yearMonth:any)=>instance({
  method:'post',
  url:`/social_securitys/historys/${yearMonth}/archive`
})

//新建

export const putstate = (yearMonth:any)=>instance({
  method:'put',
  url:`/social_securitys/historys/${yearMonth}/newReport`
})

//导出

export const exportstate = (yearMonth:any)=>instance({
  method:'get',
  url:`/social_securitys/historys/${yearMonth}/export?opType=1`,
  responseType: 'blob'
})

//查询历史报表
export const gethistorystate = (year:any)=>{
  console.log(year);
  
  return instance({
    method:'get',
    url:`/social_securitys/historys/${JSON.parse(year)}/list`
  })
}
//getdetail
export const getdetail = (id:any)=>instance.get(`/social_securitys/${id}`)
export const getpayment = (id:any)=>instance.get(`/social_securitys/payment_item/${id}`)
export const putsubmit = (obj:any,id:any)=>instance({
  method:'put',
  url:`/social_securitys/${id}`,
  data:JSON.parse(obj)
})
